using System;
using System.Xml;
using System.Collections;


namespace Scenario.Modules.FormHelper
{
	//*********************************************************************
	//
	// XMLActions Class
	//
	// The XMLActions class represents a collection base of XMLAction
	// Its imports methods from bOSdotNET.XML.Data.XMLObjectSet like get set and add
	// 
	//
	//*********************************************************************

	public class XMLFormAttributes : bOSdotNET.XML.Data.XMLObjectSet
	{
		public const string MAIN_NODE	= "FormAttributes";

		public XMLFormAttributes()
		{
			this.Init();
		}

		public XMLFormAttributes(System.Xml.XmlNode nodeList)
		{
			this.Parse (nodeList);
		}

		override public void Init()
		{
			this.RemoveAll();
		}

		override public void Parse(System.Xml.XmlNode nodeList)
		{
			this.Init();

			System.Xml.XmlNode node;

			/** find subcollection fileds to add **/
			for ( int i=0; i<nodeList.ChildNodes.Count;i++)
			{
				node = nodeList.ChildNodes[i];

				switch ( node.Name) 
				{
					case XMLFormAttribute.MAIN_NODE:
						this.Add ( new XMLFormAttribute(node));
						break;
				}
			}

		}

		override public bOSdotNET.XML.XMLNode GetXMLNode()
		{
			bOSdotNET.XML.XMLNode XMLNode = new bOSdotNET.XML.XMLNode(XMLFormAttributes.MAIN_NODE);

			for ( int i=0; i<this.Count;i++)
			{
				XMLNode.AddNode ( this[i].GetXMLNode() );
			}

			return XMLNode;
		}

	

	}
}
